<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>js动画实例</title>
    <style>
        body{
            padding: 0;
            margin: 0;
            text-align: center;
        }
        #move{
            width: 400px;
            background-color: #f7f7f9;
            margin: 10px auto;
            border: 1px solid #ccc;
        }
        #move a{
            display: inline-block;
            width: 55px;
            height: 35px;
            border: 1px solid #ddd;
            border-radius: 3px;
            background-color: #fff;
            text-align: center;
            margin: 10px 17px;
            position: relative;
            padding-top: 30px;
            color: #9c9c9c;
            font-size: 12px;
            text-decoration: none;
            line-height: 30px;
            overflow: hidden;
        }
        #move a i{
            position: absolute;
            top: 20px;
            left: 0;
            display: inline-block;
            width: 100%;
            text-align: center;
            filter: opacity(100);
            opacity: 1;
        }
        #move a:hover{
            color: #f00;
        }
        #move img{
            width: 20px;
            height: 20px;
            border: none;
        }
    </style>
    <script src="../js/new_move.js"></script>
    <script>
        window.onload = function(){
            var oDiv = document.getElementById('move');
            var aList = oDiv.getElementsByTagName('a');
            for(let i in aList){
                aList[i].onmouseover = function(){
                    var _this = this.getElementsByTagName('i')[0];
                    startMove(_this, {top: -25, opacity: 0 }, function(){
                        _this.style.top = 30 + 'px';
                        startMove(_this, {top: 20, opacity: 100});
                    });
                }
            }
        }
    </script>
</head>
<body>
    <div id="move">
        <a href="#"><i><img src="../icons/bags.png"></i><p>包包</p></a>
        <a href="#"><i><img src="../icons/shoes.png"></i><p>鞋子</p></a>
        <a href="#"><i><img src="../icons/cats.png"></i><p>宠物</p></a>
        <a href="#"><i><img src="../icons/jiaju.png"></i><p>家居</p></a>
        <a href="#"><i><img src="../icons/hair.png"></i><p>美发</p></a>
        <a href="#"><i><img src="../icons/makeup.png"></i><p>美容</p></a>
        <a href="#"><i><img src="../icons/food.png"></i><p>美食</p></a>
        <a href="#"><i><img src="../icons/baby.png"></i><p>母婴</p></a>
        <a href="#"><i><img src="../icons/picture.png"></i><p>摄影</p></a>
        <a href="#"><i><img src="../icons/fashion.png"></i><p>时尚</p></a>
        <a href="#"><i><img src="../icons/mobile.png"></i><p>数码</p></a>
        <a href="#"><i><img src="../icons/sports.png"></i><p>运动</p></a>
    </div>
</body>
</html>